package com.cll.prototype.captcha.controller.service.email;

import com.cll.prototype.common.dto.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 描述信息:
 * 自定义feignClient中远程调用异常时候的服务降级方法
 * @author CLL
 * @version 1.0
 * @date 2020/10/29 10:49
 */
@Component("sendEmailLogControllerFeignClientFallback")
public class SendEmailLogControllerFeignClientFallback implements SendEmailLogControllerFeignClient {

    private static final Logger logger = LoggerFactory.getLogger(SendEmailLogControllerFeignClientFallback.class);

    @Override
    public AjaxResult sendEmailCaptcha(String email, String captcha) {
        logger.error("****** 调用发送邮件服务进行降级");
        return AjaxResult.success(24, "邮件服务降级", -1);
    }
}
